﻿<%@ Page Theme="" Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs"
    Inherits="Web._Default" ViewStateMode="Disabled" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html >
<html lang="ch">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>系统登陆</title>
    <script src="/JS/jquery-1.11.1.min.js" type="text/javascript"></script>
    <link href="css/styleInit.css" rel="stylesheet" type="text/css" />
    <script type="text/JavaScript">
        

        $(function () {
            function wOpen() {
                <%--var winObj = window.open('DefaultN.aspx?max=1', '<%= ConfigurationManager.AppSettings["OpenWindowsType"] %>'
            , 'left=0,top=0,resizable=1,toolbar=no,menubar=no,scrollbars=no,status=no,location=no');
                //width = screen.availWidth, height = screen.availHeight
                window.opener = null; window.open('', '_self', ''); window.close();--%>

                var fulls = "left=0,screenX=0,top=0,screenY=0,toolbar=no,menubar=no,scrollbars=no,status=no,location=no";    //定义弹出窗口的参数  
                if (window.screen) {
                    var ah = screen.availHeight - 30;
                    var aw = screen.availWidth - 10;
                    fulls += ",height=" + ah;
                    fulls += ",innerHeight=" + ah;
                    fulls += ",width=" + aw;
                    fulls += ",innerWidth=" + aw;
                    fulls += ",resizable";
                } else {
                    fulls += ",resizable"; // 对于不支持screen属性的浏览器，可以手工进行最大化。 manually  
                }
                //window.opener = null;
                window.location.href = "DefaultN.aspx?max=1";
                //window.open('DefaultN.aspx?max=1', '', fulls);
                //window.open('', '_self');
                //window.close();
                              
            }
            function sError() {
                $(".txtError").text("账号或密码错误，登录失败！");
                $(".txtError").css("display", "inline-block");
            }
            function sLogError(msg) {
                $(".txtError").text(msg);
                $(".txtError").css("display", "inline-block");
            }
            function getExplorer() {
                var explorer = window.navigator.userAgent;
                if (explorer.indexOf("MSIE") >= 0) {
                    return "ie";
                }
                else if (explorer.indexOf("Firefox") >= 0) {
                    return "Firefox";
                }
                else if (explorer.indexOf("Chrome") >= 0) {
                    return "Chrome";
                }
                else if (explorer.indexOf("Opera") >= 0) {
                    return "Opera";
                }
                else if (explorer.indexOf("Safari") >= 0) {
                    return "Safari";
                }
                var isIE11 = (window.navigator.userAgent.toLowerCase().indexOf("trident") > -1 && window.navigator.userAgent.indexOf("rv") > -1);
                if (isIE11) {
                    return "ie"
                }

            }
            function ie8() {
                if (getExplorer() == "ie") {
                    var version = navigator.appVersion.split(";")[1];
                    var versingB = version.substring(6, version.length);
                    return versingB <= 8 && versingB.length > 0;
                }
                else { return false; }
            }
            if (ie8()) {
                $(window).resize(function () {
                    calcSize();
                });
                $(window).load(function () {
                    calcSize();
                })
            }
            function calcSize() {
                var bodyWidth = $("body").width();
                var bodyHeight = $("body").height();
                $(".divLogin").css({ left: (bodyWidth / 2) - 150, top: (bodyHeight / 2) - 79 });
            }
            $("#txtUserName").focus();
            $("#txtUserName").keydown(function (event) {
                if (event.keyCode == 13) { event.preventDefault(); $("#txtPassword").focus(); }
            });
            <%=jqStr %>


        })
        function login() {
            // return $("input[name='rdotype']:checked").val() == "jhs";
            // alert('您所输入的水价编号，系统中已经存在使用，请修改。');
            return true;
        }
    </script>
    <style type="text/css">
        html, body {
            height: 100%;
        }

        body {
            background-image: url(images/1.jpg);
            background-position: center center;
            background-repeat: no-repeat;
        }

        .txtNormal {
            width: 230px;
            height: 27px;
            border: 0;
            font: Arial, Helvetica, sans-serif;
            font-size: 14px;
            line-height: 30px;
            color: 9db6d1;
            clear: both;
            vertical-align: middle;
        }

        .divLogin {
            position: absolute;
            width: 500px;
            height: 150px;
            left: calc(50% - 150px);
            top: calc(50% - 78px);
            /*filter:alpha(opacity=50);
            background-color:Red;*/
            /*border:1px solid green*/
        }

        .txtUName {
            height: 29px;
            margin-left: 250px;
            margin-top: -1px;
        }

        .txtUPwd {
            height: 27px;
            margin-left: 250px;
            margin-top: 16.5px;
        }

        .btnlogin {
            margin-left: 370px;
            margin-top: 8px;
            background-color: #6fce7e;
            color: #312f39;
            font-size: 14px;
            font-family: @微软雅黑;
            border: 0;
            width: 105px;
            height: 30px;
            cursor: pointer;
        }

        .txtError {
            display: none;
            font-weight: bold;
            color: Red;
            margin-left: 105px;
            margin-top: 30px;
        }

        .text {
            margin-left: -70px;
            border-right: #0099cc 1px groove;
            border-top: 5px solid #0099cc;
            border-left: 50px solid #0099cc;
            border-bottom: 1px inset #0099cc;
            background-color: aliceblue;
        }
    </style>
</head>
<body>
    <form id="form2" runat="server" class="divLogin">
        <input type="text" id="txtUserName" name="txtUserName" class='txtNormal txtUName' runat="server"
            maxlength="20" tabindex="1" />
        <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" CssClass="txtNormal txtUPwd" TabIndex="2" MaxLength="20"></asp:TextBox>
        <div style="padding-left: 165px; padding-top: 6px">
            <dx:ASPxComboBox runat="server" ID="ItemsW" Width="120px" Height="30px">
                <Items>
                    <dx:ListEditItem Text="自来水" Value="0" Selected="true" />
                    <dx:ListEditItem Text="地表水" Value="1" />
                    <dx:ListEditItem Text="地下水" Value="2" />
                    <%--<dx:ListEditItem Text="水资源系统接口" Value="4" />--%>
                </Items>
            </dx:ASPxComboBox>
            <%--<asp:DropDownList runat="server" ID="drpWaterItem" Width="120px" Height="30px" >
                <asp:ListItem Value="0">自来水</asp:ListItem>
                <asp:ListItem Value="2">地下水</asp:ListItem>
                <asp:ListItem Value="1">地表水</asp:ListItem>
                <asp:ListItem Value="4">水资源系统接口</asp:ListItem>
            </asp:DropDownList>--%>


            <%--   <input type="radio" value="jhs" name="rdotype" checked="checked" />自来水
            <input type="radio" value="dxs" name="rdotype" />地下水
            <input type="radio" value="dbs" name="rdotype" />地表水--%>
        </div>

        <%--   <dx:ASPxDropDownEdit ID="drpWaterItem" runat="server">
           
        </dx:ASPxDropDownEdit>--%>
        <div>
            <asp:Button ID="btnLogin" runat="server" Text="登陆" OnClientClick="return login();" OnClick="btnLogin_Click" CssClass="btnlogin"
                TabIndex="3" />
            <span class="txtError">账号或密码错误，登录失败！</span>
        </div>


    </form>
</body>
</html>

